feat(android): update session replay masking precedence rules#518
Open
feat(android): update session replay masking precedence rules#518
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes Android semantics to match iOS when applying session replay masking precedence rules.
This changes existing masking behavior, but should be clearer than the previous behavior. Please see the README changes for details.
How did you test this change?
Unit tests added.
Are there any deployment considerations?
N/A
Note
Medium Risk
Changes core session replay privacy behavior by introducing explicit mask/unmask precedence and new propagation semantics, which could alter what gets redacted in captured sessions. Risk is mitigated by added unit tests covering the new precedence rules.
Overview
Aligns Android session replay masking with a strict precedence model: explicit masks (including
maskXMLViewIds) propagate to descendants and always win, explicit unmasking (ldUnmask) propagates but only when no explicit mask applies, and global privacy options (maskTextInputs,maskText, view/webview/keyword heuristics) apply only to the matched target.Implements this by splitting
PrivacyProfilematchers intoexplicitMaskMatchersvsglobalMaskMatchers, addinghasLDUnmask()support for both native views and Compose semantics, and updatingMaskCollectortraversal to carry inherited explicit state. Documentation is updated to describe the rules, new masking APIs are clarified, and newMaskCollectorTestcases validate precedence/propagation behavior; React Native Android adapter switches Observability logging toLDObserveLogging.adapter().Reviewed by Cursor Bugbot for commit f2f5317. Bugbot is set up for automated code reviews on this repo. Configure here.